//
//  FunctionBtnView.m
//  WordTutor
//
//  Created by lyh on 15/11/19.
//  Copyright © 2015年 lyh. All rights reserved.
//

#import "FunctionBtnView.h"

@implementation FunctionBtnView

+(instancetype) functionBtnView: (CGRect)frame {
    return [[self alloc]initWithFrame:frame];
}

-(instancetype)initWithFrame:(CGRect)frame {
    if (self = [super initWithFrame:frame]) {
        [self layoutSubview];
    }
    return self;
}

-(void) layoutSubview {
    CGRect frame = [UIScreen mainScreen].bounds;
    
    CGFloat width = (frame.size.width - 30) / 2.f;
    
    UIButton *newWordBtn = [[UIButton alloc]initWithFrame:CGRectMake(10, 0, width , width)];
    newWordBtn.backgroundColor = [UIColor redColor];
    [self addSubview:newWordBtn];
    
    UIButton *talkBtn = [[UIButton alloc]initWithFrame:CGRectMake(width + 20, 0, width, width)];
    talkBtn.backgroundColor = [UIColor redColor];
    [self addSubview:talkBtn];
    
    UIButton *translationBtn = [[UIButton alloc]initWithFrame:CGRectMake(10, width + 10, width, width)];
    translationBtn.backgroundColor = [UIColor redColor];
    [self addSubview:translationBtn];
    
    UIButton *moreBtn = [[UIButton alloc]initWithFrame:CGRectMake(width + 20, width + 10, width, width)];
    moreBtn.backgroundColor = [UIColor redColor];
    [self addSubview:moreBtn];

}
/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
